import request from '@/utils/request'

// 查询工单管理列表
export function listOrder(query) {
    return request({
        url: '/business/order/list',
        method: 'get',
        params: query
    })
}

//获取登录人地址
export function getLocation() {
  return request({
    url: '/business/order/getLocation',
    method: 'get'
  })
}

// 查询工单管理详细
export function getOrder(id) {
    return request({
        url: '/business/order/' + id,
        method: 'get'
    })
}

// 查询今日工单管理数量
export function getOrderNum() {
  return request({
    url: '/business/order/orderNum',
    method: 'get'
  })
}

// 查询今日工单管理数量
export function orderUser(num) {
  return request({
    url: '/business/order/orderUser/' + num,
    method: 'get',
  })
}

// 查询今日工单管理数量
export function orderRank(num) {
  return request({
    url: '/business/order/orderRank/' + num,
    method: 'get',
  })
}

// 运维人员接单量统计
export function receiveOrder(query) {
  return request({
    url: '/recordforming/order/receiveOrder',
    method: 'get',
    params: query
  })
}

// 接单来源统计
export function source(query) {
  return request({
    url: '/recordforming/order/source',
    method: 'get',
    params: query
  })
}

// 运维人员工单类型统计
export function orderType(query) {
  return request({
    url: '/recordforming/order/type',
    method: 'get',
    params: query
  })
}

// 运维人员评价统计
export function evaluate(query) {
  return request({
    url: '/recordforming/order/evolution',
    method: 'get',
    params: query
  })
}

// 运维人员时效统计
export function operateTime(query) {
  return request({
    url: '/recordforming/order/operateTime',
    method: 'get',
    params: query
  })
}

// 新增工单管理
export function addOrder(data) {
    return request({
        url: '/business/order',
        method: 'post',
        data: data
    })
}

// 修改工单管理
export function updateOrder(data) {
    return request({
        url: '/business/order',
        method: 'put',
        data: data
    })
}

// 删除工单管理
export function delOrder(id) {
    return request({
        url: '/business/order/' + id,
        method: 'delete'
    })
}
